package com.ja.subclass.controller;

import com.ja.pulldown.GetPullDownList;
import com.ja.subclass.service.SubService;
import com.ja.util.ResultBuildVo;
import com.ja.util.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

/**
 * 单例模式的下拉列表的获取
 * Created by 11936 on 2019/4/25.
 */

@RestController
//@RequestMapping("metadata")
public class MetadataController {
    @Autowired
    private SubService subService;

    //@PostMapping("getPullDownList")
    @CrossOrigin
    public ResultVo getPullDownList(@RequestBody List<String> methodKey){
//        List<StatusDown> list = new ArrayList<>();
//        for(int i = StatusEnum.values().length-1; i >= 0; i--){
//            StatusDown statusDown = new StatusDown();
//            statusDown.setLabel(StatusEnum.getStatusName(i));
//            statusDown.setValue(i);
//            list.add(statusDown);
//        }
        //调用方法
        HashMap<String, List> map = GetPullDownList.getGetPullDownList();
        return ResultBuildVo.success(map.get(methodKey));
    }
}
